home *** CD-ROM | disk | FTP | other *** search
/ New Star Software Collection / NSS_Collection.iso / 3-069 qemm 603 / 1.ima / QEMM-MAN / CH5.QEM < prev    next >
Encoding:
Text File  |  1991-10-07  |  17.8 KB  |  417 lines

  1. Chapter 5 
  2.  
  3. The LOADHI Programs
  4.  
  5. The two LOADHI programs, (LOADHI.COM and LOADHI.SYS) enable you
  6. to load TSRs, drivers, and DOS resources into available regions
  7. of high RAM. Your high memory is transformed into high RAM by
  8. QEMM386.SYS's RAM parameter. If you have run the Optimize program
  9. this has been done for you. Check your CONFIG.SYS file for the
  10. QEMM statement and be sure the RAM parameter is present. If not,
  11. refer to Chapter 3 page 16. 
  12.  
  13. This chapter explains how and when the LOADHI programs may be
  14. used and describes the command line switches available. These
  15. switches help you determine and modify the effectiveness of
  16. LOADHI in freeing up conventional memory. Freeing up this memory
  17. may enable you to:
  18.  
  19. ~Item~ run programs that would not fit in memory before,
  20.  
  21. ~Item~ add TSRs you have been doing without,
  22.  
  23. ~Item~ speed up memory-starved programs that no longer need to go
  24. to disk for their data,
  25.  
  26. ~Item~ add DOS resources to improve system response time and
  27. program effectiveness, and
  28.  
  29. ~Item~ increase the memory available to applications running in
  30. DESQview.
  31.  
  32. The LOADHI programs are very effective with or without
  33. customization by you. However, it is important to note that if
  34. LOADHI is unable to make use of high RAM for a particular program
  35. or a DOS resource, it will use conventional memory instead. Thus,
  36. your programs and DOS resources are available for use whether
  37. they were relocated or not.
  38.  
  39. In order to use these two programs effectively, you need high
  40. RAM. In this chapter, it is assumed that QEMM has mapped
  41. available memory addresses with memory. If this is not the case,
  42. you may wish to install and set up QEMM as described in Chapter
  43. 2, Installation.
  44.  
  45. ~Subhead~ Using LOADHI
  46.  
  47. Both LOADHI.SYS and LOADHI.COM load programs into high RAM. You 
  48. use LOADHI.SYS to load device drivers with an appropriate DEVICE=
  49. statement in your CONFIG.SYS file. You use LOADHI.COM to load
  50. programs either from COMMAND.COM'S command line or from within
  51. your AUTOEXEC.BAT file. Both LOADHI programs support the same set
  52. of command line options (switches) which let you alter the way
  53. LOADHI normally allocates and uses high RAM. These switches are
  54. described more fully on page 40, LOADHI Options.
  55.  
  56.  In addition, LOADHI.COM can be executed from the command line at
  57. any time to give you a listing of your current usage of high RAM.
  58. The following section describes this listing. It defines key
  59. terminology used in this chapter. And it is also the starting
  60. point for you, if and when you need to employ LOADHI's command
  61. line options.  
  62.  
  63. ~Subhead~ The LOADHI Report
  64.  
  65.  You display the LOADHI report by running LOADHI from the command
  66. line without specifying any command line option or program file
  67. to load: 
  68.  
  69. ~Step~ Type LOADHI and press <Enter>.
  70.  
  71. The LOADHI report, shown below, describes what high RAM is in use
  72. and still available, the amount of high RAM used, and the names
  73. of the programs or DOS resources using the memory. It also shows
  74. you the memory address range in use by each block within a
  75. region. 
  76.  
  77. As described in Chapter 2, QEMM locates and maps high memory
  78. areas into high RAM. These memory areas may be scattered
  79. throughout the high memory area due to the presence of BIOS and
  80. system ROM and RAM memory already in use by peripheral adapters.
  81. Each contiguous area of memory converted into high RAM is
  82. referred to as a region. Each region is given a number. Memory is
  83. allocated from a region in blocks. These regions may vary in
  84. size. Each time you load something into high RAM, LOADHI
  85. allocates a block of memory from one of these regions. That block
  86. shows up in the list for that region and the region's available
  87. size and memory area is reduced accordingly. 
  88.  
  89.  
  90. However often you call upon LOADHI to populate high RAM, there
  91. will never be more or less regions available on a particular
  92. configuration. The number of blocks listed for a given region
  93. will, however, increase as LOADHI uses this memory. 
  94.  
  95. If you display the LOADHI report before you have loaded TSRs or
  96. drivers in high RAM, you can see the number of regions found and
  97. mapped, the high memory address ranges, and the size of each
  98. region. Each region is marked as Available in the status column.
  99. This report serves as an excellent baseline for planning the best
  100. use of high RAM. The sum total of the regions' sizes gives you
  101. the upper limit to the conventional memory that can be saved by
  102. using LOADHI.
  103.  
  104.  
  105.  
  106. ~Subhead~ LOADHI.SYS
  107.  
  108.  You use the LOADHI.SYS program when you want to load a device
  109. driver into high RAM. Device drivers are essentially extensions
  110. to DOS which DOS will load on system startup as it processes your
  111. CONFIG.SYS file.  
  112.  
  113. Any statement in your CONFIG.SYS file which begins with the
  114. keyword DEVICE= instructs DOS to load the device driver which is
  115. specified following that keyword. Some common devices are memory
  116. managers, add-on peripheral device drivers, such as a disk drive
  117. or a mouse, and extensions to existing devices, such as the
  118. ANSI.SYS driver supplied with DOS that some programs use to
  119. address the video display.  
  120.  
  121. With the exception of QEMM386.SYS, which LOADHI relies upon, any
  122. device driver that you currently use or anticipate using in the
  123. future is a candidate to consider loading into high RAM.
  124. Occasionally you may find a device driver that is sensitive to
  125. its location in memory and which will not work properly, if at
  126. all, when relocated. Other device drivers may require that you
  127. experiment with the customization capabilities of LOADHI.
  128. However, for the most part you will encounter little difficulty
  129. in using LOADHI.SYS with your device drivers.
  130.  
  131. Since ANSI.SYS is available on every DOS system, we use it in the
  132. example below to show how you take advantage of LOADHI.SYS In
  133. this example, the sample CONFIG.SYS file has a statement which
  134. loads QEMM386.SYS, as well as the following statement loading
  135. ANSI.SYS:
  136.  
  137.  DEVICE=C:\DOS\ANSI.SYS
  138.  
  139. This statement instructs DOS to load the file ANSI.SYS which can
  140. be found in the DOS subdirectory of disk drive C. 
  141.  
  142. To load ANSI.SYS in high memory, you must instruct DOS to load
  143. the file LOADHI.SYS instead of ANSI.SYS. LOADHI will take care of
  144. loading the ANSI.SYS file. You do this by modifying the
  145. CONFIG.SYS statement so that it reads:
  146.  
  147.  DEVICE=C:\QEMM\LOADHI.SYS C:\DOS\ANSI.SYS
  148.  
  149. NOTE: Editing an existing DEVICE= statement simply displaces the
  150. device driver specification on the statement line. If the device
  151. driver you want to relocate takes command line switches of its
  152. own (the example ANSI.SYS has none), and you make use of any of
  153. these options, they should be retained in the edited statement
  154. also.  
  155.  
  156.  This easy modification to your CONFIG.SYS file represents the
  157. simplest way to take advantage of LOADHI's features. For many
  158. systems, this will be adequate. When you need more control over
  159. the placement of device drivers or encounter difficulty in
  160. relocating a device driver, you should see the LOADHI switches
  161. section of this chapter.  
  162.  
  163. ~Subhead~ LOADHI.COM
  164.  
  165.  You use LOADHI.COM to load TSR (Terminate and Stay Resident)
  166. programs in high memory or to relocate DOS resources (such as
  167. disk buffers and file handles) into high memory. The TSRs you
  168. customarily use are probably found in your AUTOEXEC.BAT file. DOS
  169. resources are allocated, if at all, from your CONFIG.SYS file.
  170. Other TSRs which you use only occasionally may be loaded directly
  171. from the DOS prompt (or by way of a batch file).  
  172.  
  173. This section first explains how to use LOADHI.COM to load your
  174. TSRs into high RAM. It then briefly describes how you may use
  175. LOADHI.COM in conjunction with QEMM-386's programs (BUFFERS.COM,
  176. FILES.COM, etc.) that place DOS resources in high RAM. Since
  177. these programs also perform other functions, they are more fully
  178. described in Chapter 6, The DOS Resource Programs.
  179.  
  180. In describing how to use LOADHI.COM, we use, as an example TSR, a
  181. program called DOITALL. This imaginary program resides in a disk
  182. directory called UTILS and has several command line options which
  183. modify its behavior. Our example shows two of these options: the
  184. /m option to force the program to display in monochrome and the
  185. /r option which instructs it to stay resident (it has a stand-
  186. alone mode) and available to be "popped up" on demand.  To run
  187. DOITALL, the following statement needs to be executed:
  188.  
  189.      C:\UTILS\DOITALL /m /r
  190.  
  191. This statement could be present in your AUTOEXEC.BAT file, in
  192. some other batch file you execute as needed, or a statement you
  193. enter from the DOS prompt whenever you want the program in
  194. memory. To run DOITALL out of high RAM, the above statement needs
  195. to be changed so that it executes LOADHI first:
  196.  
  197.      C:\QEMM\LOADHI C:\UTILS\DOITALL /m /r
  198.  
  199. Notice that the statement that executed the program is now a
  200. parameter to the program LOADHI. All that we have done is insert
  201. the drive and directory path for LOADHI and made LOADHI the
  202. program to be loaded. LOADHI in turn loads and executes DOITALL
  203. in high RAM. DOITALL still sees its parameters when it
  204. initializes. In many cases this simple change to your system is
  205. sufficient to free up a significant amount of memory and still
  206. enjoy the benefits of your TSR programs.  
  207.  
  208. There are also several programs included with QEMM-386 which are
  209. meant to be used in conjunction with LOADHI.COM. These programs
  210. are BUFFERS.COM, FILES.COM, FCBS.COM and LASTDRIV.COM. As their
  211. names suggest, they allow you to allocate and use the associated
  212. DOS resources out of high RAM. If your CONFIG.SYS file is
  213. currently allocating any of these resources, the use of LOADHI
  214. and these utilities frees up much of the conventional memory now
  215. devoted to them. 
  216.  
  217. Each of these programs allocate memory before they terminate. If
  218. they are in high RAM, the memory they allocate comes from high
  219. RAM. Although these programs are fully described in the Chapter
  220. 6, The DOS Resource Programs, a typical example of the use of
  221. each one with LOADHI should give you an idea about their use.
  222. These examples do omit the details about the disk and
  223. subdirectory location of the programs.
  224.  
  225. Example 1-Allocate buffers in high memory: 
  226.  
  227. Before LOADHI.COM:       
  228.      CONFIG.SYS file:    BUFFERS=20          
  229.      AUTOEXEC.BAT file :      
  230. After LOADHI.COM:        
  231.      CONFIG.SYS file:    BUFFERS=1      
  232.      AUTOEXEC.BAT file:  LOADHI BUFFERS=20
  233.  
  234. Example 2-Add 10 file handles: 
  235.  
  236. Before LOADHI.COM:       
  237.      CONFIG.SYS file:    FILES=20       
  238.      AUTOEXEC.BAT file:       
  239. After LOADHI.COM:        
  240.      CONFIG.SYS file:    FILES=10       
  241.      AUTOEXEC.BAT file:  LOADHI FILES +10
  242.  
  243. Example 3-Load FCBs in high memory: 
  244.  
  245. Before LOADHI.COM:       
  246.      CONFIG.SYS file:    FCBS=8,2       
  247.      AUTOEXEC.BAT file:       
  248. After LOADHI.COM:        
  249.      CONFIG.SYS file:    FCBS=1,0       
  250.      AUTOEXEC.BAT file:  LOADHI FCBS=8,2
  251.  
  252. Example 4-Increase last drive to include drive letter G:
  253.  
  254. Before  LOADHI.COM:      
  255.      CONFIG.SYS file:    LASTDRIVE=G         
  256.      AUTOEXEC.BAT file:       
  257. After LOADHI.COM:        
  258.      CONFIG.SYS file:    LASTDRIVE=D         
  259.      AUTOEXEC.BAT file:  LASTDRIVE=G
  260.  
  261.  ~Subhead~ LOADHI Options
  262.  
  263.  There are several command line options for LOADHI which can help
  264. you make better use of your high RAM if you find that the simple,
  265. straightforward approach is inadequate.  
  266.  
  267. The command line options may help if you have trouble loading one
  268. or more of your programs into high RAM. Some command line options
  269. are to be used if you have more candidates for high RAM than seem
  270. to fit. Another command line option lets you specify a particular
  271. region to use or exclude. There is an option that will allow you
  272. to find out how much memory a program really needs, when that is
  273. not clear either from the program documentation, or from a
  274. estimate based on its file size.  
  275.  
  276. The LOADHI command line has the following format:
  277.  
  278.   LOADHI [loadhi-opts] target-program [target-program-opts]
  279.  
  280. The brackets in the statement indicate that the item specified is
  281. optional. The target program represents the device driver or
  282. program you are loading. The last item shows the placement of
  283. options for the target program if there are any.  
  284.  
  285. Now that we know where LOADHI's options belong on the command
  286. line, we also need to know what an option looks like.
  287.  
  288. ~Item~ A LOADHI option always begins with a slash (/).  
  289.  
  290. ~Item~ Following the slash is the option name, or its
  291. abbreviation.  
  292.  
  293. ~Item~ If the option can take a value, then the next character
  294. must be a colon (:) followed by the value.  
  295.  
  296. One LOADHI option is LARGEST, which optionally can take a value.
  297. You can indicate this option in any of the following ways:
  298.  
  299.           /LARGEST       
  300.           /L        
  301.           /LARGEST:2               
  302.           /L:2
  303.  
  304. In all, there are thirteen options you may specify on a LOADHI
  305. command line, each of which are described below. Combinations of
  306. two or more options may be specified to give you greater control
  307. over the use of high RAM. These paragraphs show the full option
  308. name followed by its abbreviation. If a value is called for that
  309. is optional it is enclosed in square brackets ([ ]). The options 
  310. are: 
  311.  
  312. ~Item~ /BESTFIT or /B instructs LOADHI to use the smallest block
  313. of memory in which the program fits. Using BESTFIT tends to
  314. reserve larger regions for your larger programs. See also SIZE
  315. and GETSIZE.  
  316.  
  317. ~Item~  /HAPPIEST or /H instructs LOADHI to use the smallest
  318. block of memory in which the program will fit, provided that it
  319. does not terminate with an error. Both device drivers and TSRs
  320. return after they are initialized, and the LOADHI programs can
  321. determine if the load was successful. It was not, then LOADHI
  322. will try again with a larger area until the program exits
  323. successfully.  If necessary the program will be loaded in
  324. conventional memory.
  325.  
  326. ~Item~ /REGION:n or /R:n instructs LOADHI to load the program
  327. into the region numbered "n".  
  328.  
  329. ~Item~ /LARGEST[:n] or /L[:n] instructs LOADHI to load the
  330. program into the largest block or one particular block out of
  331. several large blocks available. The number indicated by n
  332. indicates which of these to use. For instance the option /L:2
  333. specifies the second largest block.
  334.  
  335. ~Item~ /SMALLEST[:n] or /S[:n] instructs LOADHI to load the
  336. program into the smallest block or one particular block out of
  337. several small blocks available. The number indicated by n
  338. indicates which of these to use. For instance the option /S:2
  339. specifies the second smallest block.
  340.  
  341. ~Item~ /EXCLUDEREGION:n or /XR:n instructs LOADHI to not use
  342. region number n to load the target program.
  343.  
  344. ~Item~ /EXCLUDELARGEST[:n] or /XL[:n] instructs LOADHI to not use
  345. the largest block (or the Nth largest block) to load the target
  346. program.
  347.  
  348. ~Item~ /EXCLUDESMALLEST[:n] or /XS[:n] instructs LOADHI to not
  349. use the smallest block (or the Nth smallest block) to load the
  350. target program.
  351.  
  352. ~Item~ /GETSIZE[:f] or /GS[:f] allows you to determine precisely
  353. the amount of memory a program requires. With this option LOADHI
  354. loads the program you specify and reports two memory usage
  355. values. The first value tells you how much memory (in bytes) the
  356. program required to load and initialize. The second value tells
  357. you the amount of memory the program has permanently retained for
  358. its own use. You use this option to help you custom fit your
  359. device drivers and TSRs into high RAM.
  360.  
  361.  The optional value f should be a file name. When a file name is
  362. present, LOADHI writes the program name and the two size values
  363. into this file so that you may examine it later. If the file name
  364. you specify already exists, LOADHI appends the information to
  365. this file. By systematically using the GETSIZE option with a file
  366. name you can compile the memory requirements of all the programs
  367. you wish to relocate to high RAM. This is the procedure that the
  368. Optimize program uses.
  369.  
  370.  NOTE to DESQview users: LOADHI /GETSIZE can be used to help you
  371. determine how much memory a program requires to run, so you can
  372. set an appropriate memory size. Simply run the program you are
  373. interested in a maximum memory window with LOADHI /GS. Do what
  374. you would normally do in the program. When you exit it, LOADHI 
  375. displays the amount of memory that the program used. That number
  376. (increased slightly) can be used for the memory configuration for
  377. that program.
  378.  
  379. ~Item~ /SIZE:nnnn or /SIZE:nnnnK instructs LOADHI to allocate
  380. from a block that will best fit the value nnnn. This number can
  381. be expressed in bytes (i.e 4096) or in kilobytes (i.e. 4K). The
  382. number you supply may come from the report issued by the GETSIZE
  383. option, or a number that you have determined by other means. In
  384. either case this number must represent the amount of memory the
  385. program needs to successfully initialize.  
  386.  
  387. ~Item~ /NOLO or /NL instructs LOADHI not to load the specified
  388. program at all if it will not fit in a high RAM region. This
  389. allows you to specify additional drivers, TSRs or DOS resources,
  390. that you would like to use, but only if they will be placed in
  391. high RAM.
  392.  
  393. ~Item~ /LO  instructs LOADHI to unconditionally use conventional
  394. memory instead of high RAM. You can use this option to
  395. temporarily change LOADHI statements in CONFIG.SYS or
  396. AUTOEXEC.BAT files without removing them completely.
  397.  
  398. ~Item~ /TERMINATERESIDENT or /TSR instructs LOADHI to terminate
  399. as a TSR, leaving a small stub of code (about 100 bytes)
  400. resident. This option is only useful if you are using LOADHI in
  401. combination with DOS 4's INSTALL command in CONFIG.SYS. In this
  402. case, the effect of this option is simply to suppress an error
  403. message issued by DOS indicating a failure to load a TSR when in
  404. fact LOADHI successfully relocated the program.
  405.  
  406. Finally, as a quick reminder, LOADHI will also respond to the
  407. following options on its command line:
  408.  
  409. ~Item~ /NOPAUSEONERROR or NOPE instructs LOADHI not to pause on
  410. error.
  411.  
  412. ~Item~ /PAUSE instructs LOADHI to pause while parsing commands.
  413.  
  414. ~Item~ /HELP displays the LOADHI help screen.
  415.  
  416. ~Item~ /?  lists all LOADHI command switches.
  417.